/*                                    _
 *   ___ _ __ ___ _ __ ___   ___   __| |
 *  / __| '__/ __| '_ ` _ \ / _ \ / _` |
 *  \__ \ |  \__ \ | | | | | (_) | (_| |
 *  |___/_|  |___/_| |_| |_|\___/ \__,_|                                  
 *
 *  _  _  _  _ _  _  _| _   _|_ _ |_    _ 
 * (_)(_||||(-|||(_)(_|(-  _)|_(_||_|_|_\ 
 * _/                                      
 *			  |_  _| _  _ _ 
 *			  | )(-||_)(-|     
 *			       |        
 ******************************************
 ******************************************
 ******************************************
 *  _    |_ |. _   |`    _  __|_. _  _  _
 * |_)|_||_)||(_  ~|~|_|| |(_ | |(_)| |_\
 * |                                     
 *		// Should srsmod be active?
 *		IsAllowedGameMode()
 *
 ******************************************
 ******************************************
 ******************************************
 * . _ _  _ | _  _ _  _  _ _|_ _ _|_. _  _ 
 * || | ||_)|(/_| | |(/_| | | (_| | |(_)| |
 *       |                                 
 *		Allows to check a gamemode convar stringlist against the current gamemode
 *		Has become necessary since Valve decided to give each mutation a unique gamemode string
 */


static const String:CONVAR_GAMEMODE[]		= "mp_gamemode";

static Handle:cvarGameMode					= INVALID_HANDLE;
static Handle:cvarGameModeActive			= INVALID_HANDLE;


stock bool:IsAllowedGameMode()
{
	decl String:gamemode[64], String:gamemodeactive[64];
	GetConVarString(cvarGameMode, gamemode, sizeof(gamemode));
	GetConVarString(cvarGameModeActive, gamemodeactive, sizeof(gamemodeactive));
	return StrContains(gamemodeactive, gamemode) != -1;
}

stock Handle:GetGameModeHandle()
{
	return cvarGameMode;
}

GameModeStatus_OnPluginStart()
{
	cvarGameModeActive = CreateConVar("srs_gamemodeactive", "versus,teamversus,mutation12,mutation13", " Set the gamemodes for which the plugin should be activated (same usage as sv_gametypes, i.e. add all game modes where you want it active separated by comma) ");
	cvarGameMode = FindConVar(CONVAR_GAMEMODE);
}